package dao.impl;

import javax.sql.DataSource;

import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;

import com.ibatis.sqlmap.client.SqlMapClient;

import po.Admin;
import utils.SpringBeanProxy;
import dao.AdminDao;

public class AdminDaoImpl extends SqlMapClientDaoSupport implements AdminDao {

	public AdminDaoImpl(DataSource dataSource){
		SqlMapClient sqlMapClient = (SqlMapClient)SpringBeanProxy.getBean("sqlMapClient");
		this.setSqlMapClient(sqlMapClient);
		this.setDataSource(dataSource);
	}
	
	public void add(Admin admin) {
		this.getSqlMapClientTemplate().insert("addAdmin", admin);
	}

	public void update(Admin admin) {
		this.getSqlMapClientTemplate().update("updateAdmin", admin);
	}


}
